package com.order.ctl;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * dongzhihua
 * 2022/10/28 15:53
 */
@RefreshScope
@RestController
@RequestMapping("config")
public class OrderConfigCtl {

    @Value("${config.info:}")
    private String info;
    @Value("${config.message:}")
    private String message;

    @Value("${spring.application.name:none}")
    private String application;

    @RequestMapping
    public Object config() {
        return String.format("%s\n\t-info=%s\n\t-message=%s", application, info, message);
    }
}
